#ifndef WIDGETMOVIMIENTO_H_
#define WIDGETMOVIMIENTO_H_

#include <stdio.h>
#include <list>
#include <iostream>

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

#include "Parcel.h"
#include "Event.h"
#include "Widget.h"

enum borderType {TOP_BORDER, BOTTOM_BORDER, RIGHT_BORDER, LEFT_BORDER};

class WidgetMovimiento: public Widget {

protected:
	SDL_Surface* surfaceShown;
	int angle;
	int nextX;
	int nextY;
	bool drawable;
	void surfaceReflection(SDL_Surface* objectSurface, SDL_Surface* screenSurface);
	int analyseBorderIntersection(borderType border, int surfaceWidth, int surfaceHeight, int screenWidth, int screenHeight);
public:
	WidgetMovimiento(int posX, int posY,std::string imagePath, Widget* parent = NULL);
	WidgetMovimiento(int posX, int posY,int ancho, int alto,std::string imagePath, Widget* parent = NULL);
	virtual ~WidgetMovimiento();
	virtual void showOn(SDL_Surface* canvasSurface);
	bool isDrawable();
	bool checkCollision(WidgetMovimiento* widgetMov);
	SDL_Rect getRectangle();
private:
    void initColorKey();
	void positionCorrection(SDL_Surface* surface);
};

#endif /* WIDGETMOVIMIENTO_H_ */
